package com.sczmgk.hotline_pzh.view;

import com.sczmgk.hotline_pzh.utils.MyLog;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ImageView;

public class CustomImageView extends ImageView {
	private final String TAG = "CustomImageView";
	private boolean isTouch = false;
	private MotionEvent event;

	public CustomImageView(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
	}

	public CustomImageView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public CustomImageView(Context context) {
		super(context);
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		this.event = event;
		return isTouch;
	}
	/**
	 * 设置能否被点击
	 * @param isTouchable
	 */
	public void setTouchable(boolean isTouchable){
		MyLog.d(TAG,"主页背景设置是否能点击："+isTouchable);
		isTouch = isTouchable;
		onTouchEvent(event);
	}
}
